﻿<%@ Page Language="C#" %>
<%
    string clsno = (Request.QueryString["clsno"] == null) ? "" : Request.QueryString["clsno"].Trim();
    string type = (Request.QueryString["type"] == null) ? "" : Request.QueryString["type"].Trim();
    string currpostfix = (Request.QueryString["currpostfix"] == null) ? PlugNT.Custom.WebConfig.TablePostfix.ToString() : Request.QueryString["currpostfix"].Trim();    
%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
    .box
    {
    	display:block;
    	width:200px;
    	height:15px;
    	text-align:left;
    	float:left;
    	background-color:#cccccc;
    	/*border:solid 1px #999;   #fcfcfc;*/
    }
    .lbox
    {
    	display:block;
    	text-align:left;
    	float:left;
    	color:#000000;
    }   
    .ibox
    {
    	display:block;
    	height:15px;
    	text-align:left;
    	float:left;
    	background-color:Black;
    }
    </style>
    <script language="javascript">
    function Submit()
    {
        var idstart=Trim(document.getElementById("idstart").value);
        var idend=Trim(document.getElementById("idend").value);
        if(isNaN(idstart) || isNaN(idend))
        {
            alert("请输入正确的数字");
        }
        else
        {
            //document.getElementById("loading").innerHTML="<img src=\"../images/wait.gif\" /><br />正在生成请稍后...";
            document.getElementById("loading").innerHTML="<div class='lbox'>生成进度：</div><div class='box'><div class='ibox' style='width:0px;'></div></div>";            
            document.getElementById("frmDoCreate").src="DoCreate.aspx?type=id&idstart="+idstart+"&idend="+idend+"&currpostfix=<%=currpostfix %>";
        }
    }
    function Trim(str) 
    {
        if (typeof str == 'string') return str.replace(/(^\s*)|(\s*$)/g, '');
    }
    </script>
</head>
<body>
<table style="width:100%; height:100%" border="0">
 <tr>
   <td align="center" valign="middle">
    <table id="msg_tab" style="border:solid 1px #ddd" align="center" cellpadding="0" cellspacing="10" >
     <% 
         if (type == "id")
         {
     %>
      <tr>
        <td>
         <div id="loading" style=" text-align:center;">
            开始ID：<input id="idstart" type="text" value="0" style="width:80px;" />
            结束ID：<input id="idend" type="text" value="0" style="width:80px;" />
            <input id="iptSubmit" type="button" onclick="Submit();" value=" 生成 " />
         </div>
        </td>
      </tr>
      <iframe id="frmDoCreate" src="#" width="100%" height="0" frameborder="0" scrolling="no"></iframe>     
     <%
         }
         else
         {
     %>
      <tr>
        <td>
         <div id="loading" style=" text-align:center;">
     <% 
             if (type == "shows")
             {
                 Response.Write("<div class='lbox'>生成进度：</div><div class='box'><div class='ibox' style='width:0px;'></div></div>");
             }
             else
             {
                 Response.Write("正在生成请稍后：<img src=\"../images/loading.gif\" />");
             }
     %>
         </div>
        </td>
      </tr>
      <iframe id="frmDoCreate" src="DoCreate.aspx?clsno=<%=clsno %>&type=<%=type %>&currpostfix=<%=currpostfix %>" width="100%" height="0" frameborder="0" scrolling="no"></iframe>
     
     <% 
         }
     %>
    </table>
   </td>
  </tr>
</table>    
</body>
</html>